﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace PFAGame
{
    abstract class AProjectile : AObject
    {
        protected float speed = 10f;
        protected float lifeTime = 2f;
        protected float dammage = 8.0f;

        public float Dammage
        {
            get { return dammage; }
            set { dammage = value; }
        }
        public float Speed
        {
            get { return speed; }
            set { speed = value; }
        }
        public float LifeTime
        {
            get { return lifeTime; }
            set { lifeTime = value; }
        }

        public override void update(GameTime gameTime)
        {
            direction = orientation * speed;
            position += orientation * speed * gameTime.ElapsedGameTime.Ticks / 10000000;
            lifeTime -= (float)gameTime.ElapsedGameTime.Ticks / 10000000;
            if (lifeTime < 0)
                GameplayScreen.Singleton.DeleteProjectileList.Add(this);
        }
    }
}
